import request from '@/utils/request'

/**
 * @param {String} device 用户设备编号
 * @returns 
 */
export function fetchWithdrawalOptions(params) {// 提现金额选项
    return request.get('/app/withdraw/config', {
        params
    })
}

/**
 * @param {String} device 用户设备编号
 * @param {Number} type 抽奖类型 1: 砸金蛋，2: 转盘
 */
export function fetchRewardsDetails(data) {// 抽奖
    return request.post('/app/bonus/lottery', data)
}

/**
 * @param {String} device 用户设备编号
 * @param {Number} type 抽奖类型 1: 砸金蛋，2: 转盘
 */
export function fetchLotteryConfig(data) {// 抽奖
    return request.post('/app/bonus/config', data)
}

/**
 * 
 * @param {Number} balance 提现金额
 * @param {String} device 设备号
 * @param {String} payeeAccount 付款账号email
 * @param {Number} withdrawType 提现类型 1: 金币提现  2: 现金提现
 */
export function submitApplicationWithdrawal(data) {// 提现接口
    return request.post('/app/withdraw/apply', data)
}

/**
 * @param {String} device 设备号
 * @param {Number} currency 奖励类型 1: 金币  2:  现金
 */
export function fetchWithdrawalStatement(data) {// 现金流水
    return request.post('/app/user/queryUserWallet', data)
}

/**
 * @param {String} device 设备号
 */
export function fetchWithdrawalData(params) {// 提现记录
    return request.get('/app/withdraw/list', {
        params
    })
}